<template>
  <view class="content" @click="change">
    <van-row>
      <van-col :span="4">
        私盘
      </van-col>
      <van-col :span="6">
          <switch :value="tmp.propertyPermission" active-color="#FFD851" @change="changeSwitch"/> 
      </van-col>
      <van-col :span="4">
        共有
      </van-col>
    </van-row>
    <view class="desc-area">
      <view> 关于共盘: </view>
      <view> 1.房源设置为共盘,审核通过后将不能返回设置为私盘; </view>
      <view> 2.共盘需上传该房源的房地产证审核， </view>
      <view> 且发布前，经纪人需通过实名认证。</view>
    </view>
     <van-radio-group v-model="tmp.cooperationType" v-if="tmp.propertyPermission">
      <van-radio name="0">各收各佣  </van-radio>
      <van-radio name="1"> 直对,佣金比例   <input  class="small-input" v-model="tmp.cooperationProportion"/> %</van-radio>
      <van-radio name="2">直对,佣金金额   <input  class="small-input"  v-model="tmp.cooperationAmount"/> 元</van-radio>
    </van-radio-group>

    <view class="l-title"> 房源状态 </view>
     <van-radio-group v-model="tmp.propertyStatus">
      <view class="flex al">
        <van-radio name="0">在租</van-radio>
        <van-radio name="1">已租</van-radio>
        <van-radio name="2">在售</van-radio>
        <van-radio name="3">已售</van-radio>
       </view>
    </van-radio-group>

  </view>
</template>
<script> 
export default {
  data() {
    return {
      tmp: {
        propertyPermission:true
      },
    };
  },
  watch:{
     tmp(newValue, oldValue) {
      console.log(newValue);
    }
  },
  mounted() {
    var { slogan, describe } = this.$store.state.publishInfo;
     
    console.log(this.tmp);
  },
  methods: {
    change() { 
      console.log(this.tmp); // 将更新的值 存入 全局对象 tmp
      // this.$store.dispatch("asyncTmp",this.tmp);
    },
    changeSwitch(e){ 
      console.log(e.detail); 
        
    },
  },
};
</script>  
<style   scoped> 
.desc-area {
  color: #ccc;
  font-size: 12px;
  margin: 20px 0;
}
.al{
    align-items: baseline;
}
.al van-radio{
    flex:1
}
.tip-area > view {
  margin: 5px 0;
}
.small-input {
  display: inline-flex;
  width: 80px;
  height: 18px;
  line-height: 30px;
  border: 1px solid #ccc;
  color: #ccc;
  text-align: center;
}
.flex{
  display: flex;
  margin: 5px 0;
  align-items: center;
}
.flex input{
  margin:0 10px;
}
</style>